package com.atguigu.ds.impl;

import com.atguigu.ds.Queue;

public class LinkedListQueue<E> implements Queue<E> {

    private LinkedList<E> linkedList = new LinkedList<>();


    @Override
    public int size() {
        return linkedList.size();
    }

    @Override
    public boolean isEmpty() {
        return linkedList.isEmpty();
    }

    @Override
    public void enqueue(E element) {
        linkedList.add(element);
    }

    @Override
    public E dequeue() {
        return linkedList.remove(0);
    }

    @Override
    public E front() {
        return linkedList.get(0);
    }
}
